package com.general.template.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.general.template.enums.ResultEnum;
import com.general.template.pojo.PowerExcel;
import com.general.template.service.PowerExcelService;
import com.general.template.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: 杰哥
 * Date: 2021/2/19 13:06
 * @Description:
 **/
@RestController
@RequestMapping("file")
@Api(value="导入文件url查询",description = "查询导入文件url")
public class FileQueryController {

    @Autowired
    private PowerExcelService excelService;

    @RequestMapping(value="/queryExcel/{id}",method = RequestMethod.GET)
    @ApiOperation(value="查询excel导入文件",notes = "查询excel导入文件")
    public Result<Object> queryExcel(@PathVariable("id") Integer id) {
        PowerExcel one = excelService.getOne(new QueryWrapper<PowerExcel>().eq("id", id));
        return new Result<>(ResultEnum.SUCCESS,one);
    }
}
